<?php
class Sy_Utils {
	public static function ea() {
		static $instance = NULL;
		if ($instance === NULL) {
			if (!class_exists('EasyAccount')) {
				require('../EasyAccount.php');
			}
			$instance = new \EasyAccount([
				'protocol' => EasyAccount::PROTOCOL_TCP,
				'timeout' => 1,
				'addr' => \Yaf\Registry::get('config')->ea->addr,
				'port' => \Yaf\Registry::get('config')->ea->port,
				'id' => \Yaf\Registry::get('config')->ea->id,
				'secret' => \Yaf\Registry::get('config')->ea->secret
			]);
		}
		return $instance;
	}
}